package domain

import (
	"context"
	"time"
)

type MerchantUser struct {
	Id         int32
	MerchantId int32
	Mobile     string
	Username   string
	RealName   string
	Password   string
	Salt       string
	Status     int8
	Detail     string
	HeadImage  string
	Role       int8
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type SearchMerchantUserList struct {
	MerchantId int32
	Mobile     string
	Username   int32
	Status     int8
	PageSize   int32
	PageNo     int32
}

type MerchantUserUsecase interface {
	ListMerchantUser(ctx context.Context, search *SearchMerchantUserList) ([]*MerchantUser, int32, error)
	GetMerchantUser(ctx context.Context, id int32, fields []string) (*MerchantUser, error)
	GetMerchantUserByMobile(ctx context.Context, mobile string, fields []string) (*MerchantUser, error)
	CreateMerchantUser(ctx context.Context, do *MerchantUser) (*MerchantUser, error)
	UpdateMerchantUser(ctx context.Context, do *MerchantUser, fields []string) (*MerchantUser, error)
	DeleteMerchantUser(ctx context.Context, id int32) error
}

type MerchantUserRepo interface {
	ListMerchantUser(ctx context.Context, search *SearchMerchantUserList) ([]*MerchantUser, int32, error)
	GetMerchantUser(ctx context.Context, id int32, fields []string) (*MerchantUser, error)
	GetMerchantUserByMobile(ctx context.Context, mobile string, fields []string) (*MerchantUser, error)
	CreateMerchantUser(ctx context.Context, do *MerchantUser) (*MerchantUser, error)
	UpdateMerchantUser(ctx context.Context, do *MerchantUser, fields []string) (*MerchantUser, error)
	DeleteMerchantUser(ctx context.Context, id int32) error
}
